package edu.umn.vec;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;

public class SearchUI extends Activity {
    /** Called when the activity is first created. */

	Button searchbtn;
	EditText namebox;
	EditText zipbox;
	DatePicker creationbox;
	DatePicker expirationbox;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.search);
        searchbtn = (Button) findViewById(R.id.searchbtn);
        namebox = (EditText) findViewById(R.id.namebox);
        zipbox = (EditText) findViewById(R.id.zipbox);
        creationbox =(DatePicker) findViewById(R.id.createbox);
        expirationbox =(DatePicker) findViewById(R.id.expbox);
        
        searchbtn.setOnClickListener(new SearchClick());
    }
    
    //this class defines the onclick behaviour
    private class SearchClick implements Button.OnClickListener{

		@Override
		public void onClick(View arg0) {
			// TODO Auto-generated method stub
			String[] query = {};
			query[0] = namebox.getText().toString();
			query[1] = zipbox.getText().toString();
			query[2] = String.valueOf(creationbox.getDayOfMonth());
			query[3] = String.valueOf(creationbox.getMonth());
			query[4] = String.valueOf(expirationbox.getDayOfMonth());
			query[5] = String.valueOf(expirationbox.getMonth());
		}
    	
    }
}